export default function useStatusHeight() {
	const { statusBarHeight } = uni.getSystemInfoSync();

	const barTop = statusBarHeight ?? 0;
	let barHeight, barWidth, barLeft, navHeight;
	// #ifdef MP
	// 获取胶囊按钮位置信息
	const menuButtonInfo = uni.getMenuButtonBoundingClientRect()
	// 胶囊高度
	barHeight = menuButtonInfo.height + (menuButtonInfo.top - barTop) * 2;
	// 胶囊宽度
	barWidth = menuButtonInfo.width;
	barLeft = menuButtonInfo.left;
	// #endif
	navHeight = 44 + barTop + 'px'; // 导航栏高度，44为导航栏标题高度，barTop为状态栏高度
	return {
		barTop,
		barHeight: barHeight ? barHeight : 0,
		barWidth: barWidth ? barWidth : 0,
		barLeft: barLeft ? barLeft : 0,
		navHeight: navHeight,
	};
}